<extend name='template:common'/>
<block name='css'>
    <css href='__CSS__/page.css'/>
</block>
<block name='main'>
    <h1>
        <span class="action-span"><a href="{:U('add')}">添加新商品</a></span>
        <span class="action-span1"><a href="{:U('Index/main')}">ECSHOP 管理中心</a></span>
        <span id="search_id" class="action-span1"> - {$meta_title} </span>
        <div style="clear:both"></div>
    </h1>
    <div class="form-div">
        <form action="" name="searchForm">
            <img src="__IMG__/icon_search.gif" width="26" height="22" border="0" alt="search" />
            <!-- 分类 -->
            {:onearr2select($goodsCategory,'cat_id','所有分类')}
            <!-- 品牌 -->
            {:onearr2select($brand,'brand_id','所有品牌')}
            <!-- 推荐 -->
            {:onearr2select($goods_status,'goods_status','所有推荐')}
            <!-- 上架 -->
            {:onearr2select($is_on_sales,'is_on_sale','售卖状态')}
            <!-- 关键字 -->
            关键字 <input type="text" name="keyword" size="15" />
            <input type="submit" value=" 搜索 " class="button" />
        </form>
    </div>

    <!-- 商品列表 -->
    <form method="post" action="" name="listForm" onsubmit="">
        <div class="list-div" id="listDiv">
            <table cellpadding="3" cellspacing="1">
                <tr>
                    <th>编号</th>
                    <th>商品名称</th>
                    <th>分类</th>
                    <th>供货商</th>
                    <th>品牌</th>
                    <th>货号</th>
                    <th>价格</th>
                    <th>上架</th>
                    <th>精品</th>
                    <th>新品</th>
                    <th>热销</th>
                    <th>推荐排序</th>
                    <th>库存</th>
                    <th>操作</th>
                </tr>
                <foreach name="rows" item="row">
                    <tr>
                        <td align="center">{$row.id}</td>
                        <td align="center" class="first-cell"><span>{$row.name}</span></td>
                        <td align="center"><span onclick="">{$goodsCategory[$row[goods_category_id]]}</span></td>
                         <td align="center"><span onclick="">{$brand[$row[brand_id]]}</span></td>
                          <td align="center"><span onclick="">{$supplier[$row[supplier_id]]}</span></td>
                           <td align="center"><span onclick="">{$row.sn}</span></td>
                        <td align="center"><span>{$row.shop_price}</span></td>
                        <td align="center"><img src="__IMG__/{$row.is_on_sale}.gif"/></td>
                        <td align="center"><img src="__IMG__/{$row.is_best}.gif"/></td>
                        <td align="center"><img src="__IMG__/{$row.is_new}.gif"/></td>
                        <td align="center"><img src="__IMG__/{$row.is_hot}.gif"/></td>
                        <td align="center">{$row.sort}</td>
                        <td align="center">{$row.stock}</td>
                        <td align="center">
                            <a href="{:U('edit',array('id'=>$row['id']))}" title="编辑"><img src="__IMG__/icon_edit.gif" width="16" height="16" border="0" /></a>
                            <a href="{:U('delete',array('id'=>$row['id']))}" onclick="" title="回收站"><img src="__IMG__/icon_trash.gif" width="16" height="16" border="0" /></a></td>
                    </tr>
                </foreach>
            </table>

            <!-- 分页开始 -->
            <div class='page'>
                {$page_html}
            </div>
            <!-- 分页结束 -->
        </div>
    </form>
</block>